package com.neusoft.service;

import java.util.List;

import com.neusoft.bean.AdminInfoBean;
import com.neusoft.bean.AdminInfoBeanQuery;
import com.neusoft.dao.AdminInfoDao;
import com.neusoft.db.DBProvider;
import com.neusoft.util.MyUtil;

public class AdminInfoService {
	
	/**
	 * 验证登录
	 * 根据表单中输入的用户名和密码作为数据查询条件进行查询
	 * 
	 * @param aib
	 * 			实体bean对象
	 * @return	查询结果集
	 */
	public List<AdminInfoBean> doAdminLogined(AdminInfoBean aib){
		//默认值
		List<AdminInfoBean> adminLst = null;
		
		//调用DBProvider中的查询方法进行查询操作
		adminLst = MyUtil.getInstance(DBProvider.class).getMyMapper(AdminInfoDao.class).selectAdminInfoLogin(aib);
		return adminLst;
	}
	
	
	/**
	 * 注册管理员信息
	 * @param aib
	 * 			传输管理员信息的实体bean
	 * @return 添加信息的条数
	 */
	public int doAddAdminInfo(AdminInfoBean aib) {
		int i = 0;
		
		i = MyUtil.getInstance(DBProvider.class).getMyMapper(AdminInfoDao.class).insertSelective(aib);
		return i;
		
	}
	/**
	 * 查询所有管理员的信息
	 * @param descOrasc
	 * 				查询信息的显示排序方式
	 * @return 查询结果集
	 */
	public List<AdminInfoBean> getAllAdminInfo(){
		
		List<AdminInfoBean> aib = MyUtil.getInstance(DBProvider.class).getMyMapper(AdminInfoDao.class).selectAllAdminInfo();
		return aib;
	}


	
	
	/**
	 * 条件查询
	 * @param adminBQ
	 * 			查询条件载体bean
	 * @return 查询结果集
	 */
	public List<AdminInfoBean> getAdminInfo(AdminInfoBeanQuery adminBQ){
		
		List<AdminInfoBean> aib = MyUtil.getInstance(DBProvider.class).getMyMapper(AdminInfoDao.class).selectAdminInfoByParas(adminBQ);
		return aib;	
	}
	/*public int deleteAdminInfo(AdminInfoBeanQuery adminBQ) {
			int i = MyUtil.getInstance(DBProvider.class).getMyMapper(AdminInfoDao.class).deleteByParas(adminBQ);
			return i;
	}*/
	
	
	
}
